import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { DeviceHeartDocument } from 'src/schema/DeviceHeart.shcema';

@Injectable()
export class DeviceService {
    constructor(@InjectModel('device_heart') private deviceHearModel: Model<DeviceHeartDocument>) {}
    async deviceHeart(simCardNo:string) {
        let result = await this.deviceHearModel.findOne({simCardNo : simCardNo})
        return result ? result.timestamp : 0
    }
}
